package com.wuming.house.service.impl;

import com.wuming.house.dao.GoodImageMapper;
import com.wuming.house.model.GoodImage;
import com.wuming.house.service.GoodImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author xuhuai
 * @createTime 2019/8/28 15:42
 * @Description:
 */
@Service
public class GoodImageServiceImpl implements GoodImageService {

    @Autowired
    private GoodImageMapper goodImageMapper;

    @Override
    public void saveImage(GoodImage goodImage) {
        try {
            goodImageMapper.insert(goodImage);
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    @Override
    public GoodImage getImageById(Integer id) {
        try {
            return goodImageMapper.selectByPrimaryKey(id);
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }
}
